﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpWeb
{
    /// <summary>
    /// script标签
    /// </summary>
   public class ScriptTag:TagComponent
    {
       public ScriptTag()
       {

       }
       public ScriptTag(string script)
       {
           this._Script = script;
       }
       protected override bool CloseItSelf
       {
           get { return false; }
       }

       protected override string TagName
       {
           get { return "script"; }
       }

       public string type
       {
           get { return this.Attributes["type"]; }
           set { this.Attributes["type"] = value; }
       }

       private string _Script;
       /// <summary>
       /// 脚本内容
       /// </summary>
       public string Script
       {
           get { return _Script; }
           set { _Script = value; }
       }

       protected override void OnRenderContent(StringBuilder sb, ComponentContext context)
       {
           base.OnRenderContent(sb, context);
           sb.AppendLine();
           sb.AppendLine(this.Script);
       }
    }
}
